/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language;

import java.io.IOException;
import java.util.HashMap;

public class ConstRef extends Const
{
	String _constName;
	
	

	public ConstRef(int line, String constName)
	{
		super(line);
		_constName = constName;
	}



	@Override
	public void write(Appendable sb, ConstMapper constMap)
			throws ReferenceNotFoundException, IOException
	{
		Const value = constMap.get(_constName);
		if (value == null) throw new ReferenceNotFoundException(getLine(), _constName);
		value.write(sb, constMap);
		
		
	}
}
